import styled from 'styled-components'

interface IGlobalModal {
  $totalW: number
  $totalH: number
}

export const GlobalModalWrapper = styled.div<IGlobalModal>`
  width: ${(props) => props.$totalW + 'px'};
  height: ${(props) => props.$totalH + 'px'};
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  overflow: hidden;
`

interface IHeader {
  $headerBgc?: string
}

export const GlobalModalHeaderWrapper = styled.div<IHeader>`
  color: #fff;
  font-size: 14px;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #333;
  position: relative;
  background-color: ${(props) => props.$headerBgc || '#333'};

  .close {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    &:hover {
      background-color: #333;
    }
  }
`

export const GlobalModalBodyWrapper = styled.div`
  flex: 1;
  padding: 20px;
  position: relative;
  z-index: 99999;
  background-color: #fff;
`

export const GlobalModalFooterWrapper = styled.div`
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-color: #fff;
  .btn {
    padding: 8px 15px;
    outline: none;
    margin-right: 20px;
    border-radius: 5px;
    background-color: #ff3a3a;
  }
  .cancel {
    background-color: #eee;
  }
`
